var express = require('express');
var router = express.Router();

const {getShops,updateShops,addShops} = require("../service/shopsService")
// 设置前后端接口的二级路径

// 获取门店
router.get('/getShops', async function (req, res, next) {
  // 接收前端发送过来的数据
  // console.log(req.query)
  const data = await getShops(req.query)
  console.log("当前shop",data)
    res.send(data)
});

//修改门店
router.post("/updateShops",async function (req, res, next) {
  // 接收前端发送过来的数据
  console.log(req.body)
  const data = await updateShops(req.body)
  // console.log("修改",data)
    res.send(data)
});



// 新增班级
router.post('/addShops', async function (req, res, next) {
  // 接收前端发送过来的数据
  console.log(11111111111,req.body)
  const data = await addShops(req.body)
    res.send(data)
});





module.exports = router;